package com.bnzj.core.config;

import com.bnzj.core.webflux.security.CustomServerAuthenticationEntryPoint;
import com.bnzj.core.webflux.security.WebfluxAccessDeniedHandler;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName SecurityReactiveConfiguration
 * @Description TODO
 * @Author
 * @Date 2020/3/10
 * @Version V1.0
 **/
@Configuration
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
public class SecurityReactiveConfiguration {

    @Bean
    public CustomServerAuthenticationEntryPoint customServerAuthenticationEntryPoint(){
        return new CustomServerAuthenticationEntryPoint();
    }

    @Bean
    public WebfluxAccessDeniedHandler webfluxAccessDeniedHandler(){
        return new WebfluxAccessDeniedHandler();
    }
}
